﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Noodles.Core.Repositories;
using Noodles.Core.Model;
using NHibernate;
using NHibernate.Criterion;
using Noodles.Core.DBSettings.DBProviders;


namespace Noodles.Core.Repositories.Queries
{
   /** class GetBlogsQuery:IPagedQuery<BlogPost>
    {
        public PagedData<Comment> Execute(ISession session,  int NumberOfPages, int CurrentPage)
        {
            var total = session
               .QueryOver<BlogPost>()
               .ToRowCountQuery()
               .FutureValue<int>();

            var results = session
                .QueryOver<BlogPost>()
                //.Fetch(x => x.).Eager()
                .OrderBy(x => x.CreateDate).Desc()
                //.Where(x => x.IsActive != 0)
                .Skip(NumberOfPages * (CurrentPage - 1))
                .Take(NumberOfPages)
                .List();

            return new PagedData<BlogPost>();
        }
    * **/
    
}
